# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Maintainer: Tim Hatch <tim@timhatch.com>

pkgname=python-termcolor
pkgver=2.2.0
pkgrel=2
pkgdesc="ANSI Color formatting for output in terminal"
arch=('any')
license=('MIT')
url="https://github.com/termcolor/termcolor"
depends=('python')
makedepends=('python-build' 'python-installer' 'python-hatch-vcs')
checkdepends=('python-pytest')
source=(https://pypi.python.org/packages/source/t/termcolor/termcolor-$pkgver.tar.gz)
sha256sums=('dfc8ac3f350788f23b2947b3e6cfa5a53b630b612e6cd8965a015a776020b99a')

build() {
  cd termcolor-$pkgver
  python -m build --no-isolation --wheel
}

check() {
  cd termcolor-$pkgver
  PYTHONPATH="$PWD/src" pytest
}

package() {
  cd termcolor-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 COPYING.txt -t "$pkgdir"/usr/share/licenses/$pkgname/
}
